<?php
/**
 * Created by PhpStorm.
 * User: linux
 * Date: 12/01/2018
 * Time: 1:17 PM
 */

namespace Criteria\Criteria;


class CriteriaFemal implements Criteria
{
    /**
     * 过滤 剩下女性
     * @param array $persons
     * @return mixed
     */
    function meetCriteria(array $persons) : array
    {
        $femalePersons = [];
        foreach ($persons as $person) {
            if ($person->getGender() == 'FEMALE') {
                $femalePersons[] = $person;
            }
        }
        return $femalePersons;
    }
}